﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace LingYue_PictureProcessCenter.Core.PictureInfo
{
    public class RealEsrPictureInfoImpl : BasePictureInfoImpl
    {
        public RealEsrPictureInfoImpl(BasePictureInfoImpl info)
        {
            InputPath = info.InputPath;
            OutputPath = info.OutputPath;
            GPUID = "auto";
            // 默认放大倍数是4倍
            Scale = info.Scale;
            SelectModel = "realesrgan-x4plus";
            TTLMode = false;
            Format = "png";
        }

        public string GetCommandString()
        {
            return String.Format(
                "-i \"{0}\" -o \"{1}\" -g {2} {3} -s {4} -n {5}",
                InputPath,
                String.Format("{0}\\{1}_output.{2}", OutputPath, System.IO.Path.GetFileNameWithoutExtension(InputPath), Format),
                GPUID,
                TTLMode ? "-x" : "",
                Scale,
                SelectModel);
        }

        public string GPUID { get; set; }
        public string SelectModel { get; set; }
        public bool TTLMode { get; set; }
        public string Format { get; set; }
    }
}